<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class THisdataSingle extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_hisdata_single', function (Blueprint $table) {
             $table->engine = 'MyISAM';
             $table->charset = 'utf8';
             $table->collation = 'utf8_general_ci';
            // CONTENT
            $table->increments('hd_index')->nullable(false)->comment('');
			$table->datetime('rd_updatetime')->nullable(false)->comment('');
			$table->datetime('hd_datetime')->nullable(false)->comment('');
			$table->unsignedInteger('pdi_index')->nullable(false)->default(0)->comment('');
			$table->string('hd_upsmanuinfo', 25)->nullable()->default('')->comment('');
			$table->string('hd_upsmactype', 25)->nullable()->default('')->comment('');
			$table->string('hd_upsver', 25)->nullable()->default('')->comment('');
			$table->string('hd_upsvolr', 25)->nullable()->default('')->comment('');
			$table->string('hd_upscurr', 25)->nullable()->default('')->comment('');
			$table->string('hd_upsbatvolr', 25)->nullable()->default('')->comment('');
			$table->string('hd_upsfreqr', 25)->nullable()->default('')->comment('');
			$table->float('hd_upsinvol', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_upsdefvol', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_upsoutvol', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_upscurload', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_upsinfreq', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ups1batvol', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_upstemp', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_BattCap', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_OutMaxVol', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_OutMinVol', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_BatTemp', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_BatAllVol', 9, 2)->nullable()->default(0)->comment('');
			$table->float('hd_ReTime', 9, 2)->nullable()->default(0)->comment('');
			$table->boolean('hd_upssound')->nullable()->default(0)->comment('');
			$table->boolean('hd_upspoweroff')->nullable()->default(0)->comment('');
			$table->boolean('hd_upstest')->nullable()->default(0)->comment('');
			$table->boolean('hd_upsfailstat')->nullable()->default(0)->comment('');
			$table->boolean('hd_upsbypassstat')->nullable()->default(0)->comment('');
			$table->boolean('hd_upsbatvollow')->nullable()->default(0)->comment('');
			$table->boolean('hd_upsacfail')->nullable()->default(0)->comment('');
			$table->boolean('hd_LoadAlarm')->nullable()->default(0)->comment('');
			$table->boolean('hd_upsdisconn')->nullable()->default(0)->comment('');
			$table->boolean('hd_NetCom')->nullable()->default(0)->comment('');
			$table->unique('hd_index', 'hd_index');
			
        });

        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('t_hisdata_single');
    }
}
